using System;
using System.Collections.Generic;
using System.Text;

namespace TinyLogger
{
    /// <summary>
    /// Collection of Loggersinks
    /// </summary>
    public class CompositeLoggerSink : ILoggerSink
    {
        private List<ILoggerSink> loggers = new List<ILoggerSink>();

        public void AddLog(LogLevel level, string logString)
        {
            foreach (ILoggerSink logger in loggers)
            {
                logger.AddLog(level, logString);
            }
        }

        public void AddLoggerSink(ILoggerSink logger)
        {
            this.loggers.Add(logger);
        }

        public bool RemoveLoggerSink(ILoggerSink logger)
        {
            return loggers.Remove(logger);
        }

    }
}
